#!/usr/bin/env python
# -*- coding:utf-8 -*- 
#@author: rui.xu <mrhaigui@gmail.com>
#Filename:
import hashlib
import web

def md5(str):
	return hashlib.md5(str).hexdigest()

def sha1(str):
	return hashlib.sha1(str).hexdigest()
def if_login(cookie):
	auth = False
	try:
		usercheck = cookie.usercheck
		if usercheck:
			###hashlib.md5("daxuxu"+"kiss me").hexdigest()
			if usercheck == 'c322dfcde9663edd738649c75ef1ffeb':
				auth = True
	except Exception,e:
		pass
	return auth

